# 打印List中的最大元素
def print_largest_element_in_list(l):
    if not isinstance(l, list):
        print('input is not type of list!')
        return

    if len(l) == 0:
        print('list is empty!')
        return

    largest = l[0]
    for v in l:
        if v > largest:
            largest = v

    print(f'the largest element is: {largest}')


if __name__ == '__main__':
    # 调用自定义函数
    l = [100, -100, 99, 1, 5, -8, 2, 1000, 57, 5, 1]
    print_largest_element_in_list(l)
